package com.newland.boss1.zxy;

import org.apache.servicecomb.provider.rest.common.RestSchema;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : zhangxuyuan
 * @Project: servicecombexample
 * @Package com.newland.boss1.zxy
 * @date Date : 2021年02月20日 15:03
 */
//rest方式调用类似于springcloud
@RestSchema(schemaId = "restHelloWorld")
@RequestMapping("/")
@RestController
public class HelloWorldEndPointRestImpl implements HelloWorldEndPoint {

    @Value("${server.port}")
    private String port;

    @GetMapping("/sayhello")
    @Override
    public String sayHello(@RequestParam("name") String name) {
        return "hello "+name+" "+port+" rest";
    }
}
